package com.unswift.window.listener;

import java.awt.Component;

import javax.swing.JTextField;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument;

import com.unswift.constant.ActionConstant;

@SuppressWarnings("serial")
public class InputDocument extends PlainDocument implements ActionConstant{
	
	private String action;
	private String initValue;
	private JTextField input;
	private Component comp;
	
	public InputDocument(String action, Component comp) {
		this.action=action;
		this.comp=comp;
	}
	
	public InputDocument(String action, JTextField input, Component comp) {
		this.action=action;
		this.input=input;
		this.comp=comp;
	}

	@Override
	public void insertString(int offs, String str, AttributeSet attribute) throws BadLocationException {
		super.insertString(offs, str, attribute);
	}
	
	@Override
	public void remove(int offs, int len) throws BadLocationException {
		super.remove(offs, len);
	}
	
	public void setInitValue(String initValue) {
		this.initValue = initValue;
	}
	public String getInitValue() {
		return initValue;
	}
	public void setInput(JTextField input) {
		this.input = input;
	}
}
